<?php

namespace common\traits;

use Yii;
use common\helpers\ArrayHelper;

/**
 * Description of Constants
 *
 * @author emhome
 */
trait DataPierces {

    private $_pierces;

    public function setPierces($pierces) {
        $this->_pierces = $pierces;
    }

    public function getPierces($key = null, $default = null) {
        $data = $this->_pierces;
        if ($key !== null) {
            return ArrayHelper::getValue($data, $key, $default);
        }
        return $data;
    }

}
